<script setup lang="ts">
// TAG 砂石模块的主页面
import ChildrenRouterList from '/src/lib/action/children-router-list.vue';
import { infoStore } from '../store/info';
const info = infoStore()
let Nickname = info.nickname

withDefaults(
    defineProps<{
        moduleName: string,
        // 当前页面路由
        parentPath: string
        // 路由表
        routeList: { [props: string]: any }
    }>(),
    {

    }
);

</script>
<template lang="pug">
.lay
    nav
        header
            img.logo(src="/src/res/svg/logo1.png")
            .right  
                .r-l {{ moduleName }}
                .r-r {{ Nickname }}
        ChildrenRouterList(:parentPath="`${parentPath}`",:routeList="routeList")
    main
        router-view
</template>
<style lang="scss" scoped>
.lay {
    // display: grid;
    // grid-template-areas: "nav main" "nav main";
    // grid-template-columns: auto 1fr;
    // grid-template-rows: auto 1fr;
    overflow: auto;
    height: 100%;
    background-color: #f0faf2;
    position: relative;
    > nav {
        z-index: 1;
        // min-height: calc(100% - 40px);
        width: 300px;
        margin: 20px;
        top: 0;
        bottom: 0;
        overflow: auto;
        position: absolute;
        overflow: auto;
        padding: 0 10px;
        grid-area: nav;
        border-radius: 20px;
        box-shadow: 1px 1px 6px #eee;
        background-color: #fff;
        > header {
            position: sticky;
            top: 0;
            z-index: 2;
            display: flex;
            align-items: center;
            height: 72px;
            padding: 0 20px;
            justify-content: space-between;
            background-color: #fff;
            border-bottom: #f0faf2 1px solid;
            overflow: hidden;
            .logo {
                
                height: 100px;
    margin-left: -12px;
            }
            .right {
                text-align: center;
                display: flex;
                font-family: Source Han Sans CN;
                font-size: 1em;
                align-items: center;
                .r-l {
                    border-radius: 50px;
                    background-color: #6dd993;
                    color: #fff;
                    font-size: 0.8em;
                    font-weight: bold;
                    padding: 5px 10px;
                }
                .r-r {
                    margin-left: 10px;
                }
            }
        }
    }
    > main {
        position: absolute;
        right: 0;
        top: 0;
        bottom: 0;
        left: 0;
        padding: 20px;
        padding-left: 340px;
        overflow: auto;
    }
    /* & {
        > main {
            padding: 10px;
            padding-top: 96px;
            padding-left: 320px;
            margin: auto;
            max-width: 1500px;
        }
        > nav {
            z-index: 99;
            margin-top: 96px;
            > header {
                position: fixed;
                overflow: hidden;
                height: 70px;
                top: 0;
                left: 0;
                right: 0;
                width: auto;
                min-height: auto;
                margin: 10px;
                border-radius: 20px;

                box-shadow: 1px 1px 6px #eee;
            }
        }
    } */
}
</style>